﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="FoodByTag.aspx.vb" Inherits="Week3Wscc.FoodByTag" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Food By Tags<br />       
    </h2>
    <p>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" 
            CellPadding="4" DataSourceID="SqlDataSource1" HorizontalAlign="Center">
            <Columns>
                <asp:BoundField DataField="FoodName" HeaderText="FoodName" 
                    SortExpression="FoodName" />
                <asp:BoundField DataField="FoodSize" HeaderText="FoodSize" 
                    SortExpression="FoodSize" />
                <asp:BoundField DataField="Tag" HeaderText="Tag" SortExpression="Tag" />
                <asp:BoundField DataField="FoodBrand" HeaderText="FoodBrand" 
                    SortExpression="FoodBrand" />
                <asp:BoundField DataField="FoodDescription" HeaderText="FoodDescription" 
                    SortExpression="FoodDescription" />
            

                <asp:TemplateField HeaderText="User">
                <ItemTemplate>
                <a href='Profile.aspx?FoodUser=<%# Eval("FoodUser") %>'><%# Eval("FoodUser") %>
                

</a>
                </ItemTemplate>
                </asp:TemplateField>



                <asp:TemplateField HeaderText="Picture">
                <ItemTemplate>
                <a href="FoodDetail.aspx?ID=<%#Eval("ID") %>">
                <img src="<%#Eval("FoodPicture")%>" style="width:200px;height:150px" /></a>
                </ItemTemplate>
                </asp:TemplateField>

            </Columns>
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <RowStyle BackColor="White" ForeColor="#330099" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <SortedAscendingCellStyle BackColor="#FEFCEB" />
            <SortedAscendingHeaderStyle BackColor="#AF0101" />
            <SortedDescendingCellStyle BackColor="#F6F0C0" />
            <SortedDescendingHeaderStyle BackColor="#7E0000" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FoodConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:FoodConnectionString.ProviderName %>" 
            
            
            SelectCommand="SELECT [Expr1000], [Tag], [ID], [FoodName], [FoodBrand], [FoodSize], [FoodDescription], [FoodUser], [FoodPicture] FROM [FoodTagView] WHERE ([Tag] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="Tag" QueryStringField="Tag" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>

        
    </p>
        
    <p>
    </p>


			



</asp:Content>
